package com.mccrea.pattern.state;

/**
 * @Classname HighState
 * @Description 优秀
 * @Date 2021/5/24 0024 15:08
 * @Created by Mccrea_Gao
 */
public class HighState extends AbstractState {

    public HighState(AbstractState state) {
        scoreContext = state.scoreContext;
        stateName = "优秀";
        score = state.score;
    }

    @Override
    public void checkState() {
        if (score < 60) {
            scoreContext.setState(new LowState(this));
        } else if (score < 90) {
            scoreContext.setState(new MiddleState(this));
        }
    }
}
